#include <stdio.h>

int fibonacci(int n)
{
  if (n <= 1)
    return n;
  else
    return fibonacci(n - 1) + fibonacci(n - 2);
}

int main()
{
  int n, i;
  printf("请输入斐波那契数列的项数：");
  scanf("%d", &n);

  printf("斐波那契数列的前 %d 项为：", n);
  for (i = 0; i < n; i++)
  {
    printf("%d ", fibonacci(i));
  }
  printf("\n");

  return 0;
}